import request from '@/common/vmeitime-http';

//顾问之家
export function adviserHome(id) {
   return request.request({
     url: `/seller/mall/home/${id}`
   })
}

//专属客户今日新增
export function adviserTodayClient(id) {
   return request.request({
     url: `/seller/mall/customer/today/${id}`
   })
}

/**
 * 用户拨打置业顾问电话
 * @param type {Number} 0电话 1微信 2查看二维码 5代理公司
 * @param id {Number} 销售ID
 * @param pid {Number} 该楼盘ID
 * @param ext_pid {Number} 被继承的楼盘ID
 * 
*/
export function userCallAdviser(data) {
   return request.request({
     url: `/product/mall/v5/connection/${data.id}`,
     method: 'post',
     data
   })
}

//注销置业顾问
export function cancellationAPI() {
   return request.request({
     url: `/seller/mall/cancel`,
     method: 'post'
   })
}

//置业顾问反馈
export function adviserFeedback(data) {
   return request.request({
     url: `/seller/mall/feedback`,
     method: 'post',
     data: data
   })
}

/**
 * 置业顾问锁定客户
 * share 是否分享页面进入
 * puid 置业顾问userinfo.id
 * pid 楼盘Id
 */
export function dispatchClient(data) {
    if(data.pid&&data.puid) {
        return request.request({
            url: `/seller/mall/dispatch`,
            method: 'post',
            data
        })
    }
}

